package com.ymatou.activity.a.service;

import java.io.IOException;
import java.util.List;
import java.util.Map;

import org.apache.http.client.ClientProtocolException;
import org.json.JSONObject;

import com.ymttest.business.YmatouAutoTestCall;
import com.ymttest.business.service.ActivityCallService;
import com.ymttest.utils.EnvSetup;

public class CloseActivityCall extends YmatouAutoTestCall{

	private static String opurl ="/Activity/CloseActivity";
	
	public CloseActivityCall() {
		super(EnvSetup.getSystemUrl("activity"),opurl,"POST","JSON");
	}
	@Override
	public void addDefHeader() {
		client.addHeader("Cookie", cookie);
		client.addHeader("Content-Type", "application/json; charset=UTF-8");
	}
	
	public JSONObject callAndGetReturnData(List<String> cookieList,Map<String, Object> updateMap){
		this.setCookies(cookieList);
		return super.callAndGetReturnData(updateMap);
		
	}
	
	public static void main(String[] args) throws ClientProtocolException, IOException {
		List<String> loginCoList = ActivityCallService.getLoginCookieList(EnvSetup.getData("activityLoginName"), EnvSetup.getData("activityLoginPswd"));
		new CloseActivityCall().callAndGetReturnData(loginCoList,null);
	}

}
